#include <bits/stdc++.h>
using namespace std;
#define N 10005 
template<class T>
class Queue
{
private:
	int que[N], head, tail;
public:
	Queue()
	{
		head = tail = 0;
	}
	void push(T a)
	{
		tail = (tail + 1) % N;
		que[tail] = a;
	}
	void pop()
	{
		head = (head + 1) % N;
	}
	T front()
	{
		return que[(head+1)%N];
	}
	T back()
	{
		return que[tail];
	}
	bool empty()
	{
		return head == tail;
	}
	bool full()
	{
		return head == (tail+1)%N;
	}
	int size()
	{
		return (tail + N - head) % N;
	}
};

int main()
{
    Queue<int> que;
	for(int i = 1; i <= 10; ++i)
		que.push(i);
	cout << que.size() << endl;
	for(int i = 1; i <= 5; ++i)
	    que.pop();
	for(int i = 11; i <= 15; ++i)
		que.push(i);
	cout << que.size() << endl;
    return 0;
}
